Ext.define('Admin.view.news.NewsReview', {
    extend: 'Admin.ux.PageGrid',
    xtype: 'newsreview-view',
    title: '新闻管理',
    viewModel: {
        stores: {
            data: {
                type: 'news-store',
                autoLoad: true
            }
        }
    },

    controller:'news',

    columns: [
        { xtype: 'rownumberer',width:80,text:'行号'},
        { xtype:'gridcolumnview', text: '序号', dataIndex: 'id'},
        { xtype:'gridcolumnview', text: '标题', dataIndex: 'title'},
        { xtype:'gridcolumnview', text: '新闻类型', dataIndex: 'channelid'},
        { xtype:'gridcolumnview',text: '内容摘要', dataIndex: 'content'},
        { text: '状态', dataIndex: 'state', width:60,renderer:function(value){
                if(value == 0){
                    return "<font color='green'><b>启用</b></font>";
                }else{
                    return "<font color='red'><b>禁用</b></font>";
                }
            }},
        { xtype:'gridcolumnview', text: '发布时间', dataIndex: 'create_time'},
        { xtype:'gridcolumnview', text: '发布人', dataIndex: 'Creater'},

        {
            menuDisabled: true,
            sortable: false,
            xtype: 'actioncolumn',
            width: 100,
            text:'查看',
            items: [
                {
                    iconCls: 'array-grid-buy-col',
                    tooltip: '查看',
                    handler:'detailAction',
                    showText: '查看'
                }
            ]
        },
        {
            menuDisabled: true,
            sortable: false,
            xtype: 'actioncolumn',
            width: 100,
            text:'审核通过',
            items: [
                {
                    iconCls: 'array-grid-buy-col',
                    tooltip: '审核通过',
                    handler:'reviewAction',
                    showText: '审核通过'
                }
            ]
        }
    ],
    tbar:[
        {
            xtype : 'keysearchfield'
        },
        '-',
        {
            xtype: 'tagfield',
            fieldLabel: '类型',
            emptyText:'全部',
            id:'select_type_id',
            displayField: 'type_name',
            valueField: 'type_id',
            queryMode: 'local',
            width: 200,
            minChars :1,
            remoteFilter: true,
            editable :true,
            forceSelection :true,
            filterPickList: true,
            name:'type_id',
            store: Ext.create('Ext.data.Store',{
                fields: ['type_id','type_name'],
                data: [
                    [1,'公司新闻'],
                    [2,'行业资讯'],
                    [3,'通知公告'],
                    [4,'政策法规'],
                    [5,'其他']
                ],
                autoLoad:true
            })
        }
     ]

});
  